package com.community.util;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 时间工具类
 */
public class DateTimeUtil {

    public static String convertToString(Date date,String pattern){
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat();
        simpleDateFormat.applyPattern(pattern);
        String dateString = simpleDateFormat.format(date);
        return dateString;
    }
}
